/*
 * XMLConfigFileParameters.java
 *
 * Created on 29 de Março de 2010, 9:58
 *
 */

package intopo.game;

import util.xml.XMLParseException;

import org.w3c.dom.Node;
import java.lang.reflect.Constructor;
import java.util.Map;

/**
 * Provides the basic parameters to read from a XML configuration file the game and the population of strategies.
 * @author pedro
 */
public interface XMLConfigFileParameters<S extends Strategy<S>, G extends Game<S>>
{
	String getRootNodeName ();

	/**
	 * Return a map that associates tag names to game constructors. The XML file should only have a single tag whose name is a key of the returned map.
	 */
	Map<String, Constructor<? extends G>> getGameConstructor ();

	/**
	 * Return a map that associates tag names to strategy constructors.
	 */
	Map<String, Constructor<? extends S>> getStrategyConstructors ();
	
	/**
	 * Game or strategy specific parameters can be parsed by implementors of this method.
	 * @param rootNode The root node of the document.
	 */
	void parse (Node rootNode)
		throws XMLParseException;
}
